$.ajax({
	type: "post",
	dataType: "json",
	url: "http://www.516code.cn/homePage/homepage/QueryProductAll.do",
	success: function(msg) {
		for(var i = 0; i < msg.data.length; i++) {
			$("#img").append("<div class='gallery-item cars col-md-3 col-sm-4 col-xs-12'><a href='http://www.516code.cn/产品/"+msg.data[i].productImg+"' target='_blank' class='gallery-image image-popup'><img src='http://www.516code.cn/产品/"+msg.data[i].productImg+"' alt=''/><div class='content'><i class='icofont icofont-search'></i><h4>"+msg.data[i].productName+"</h4></div></a></div>");
		}
	}
});
$("button[name=button1]").click(function(){
	$("#img").empty();
	$.ajax({
	type: "post",
	dataType: "json",
	url: "http://www.516code.cn/homePage/homepage/QueryProductAll.do",
	success: function(msg) {
		for(var i = 0; i < msg.data.length; i++) {
			$("#img").append("<div class='gallery-item cars col-md-3 col-sm-4 col-xs-12'><a href='http://www.516code.cn/产品/"+msg.data[i].productImg+"' target='_blank' class='gallery-image image-popup'><img src='http://www.516code.cn/产品/"+msg.data[i].productImg+"' alt=''/><div class='content'><i class='icofont icofont-search'></i><h4>"+msg.data[i].productName+"</h4></div></a></div>");
		}
	}
});
})
$("button[name=button2]").click(function(){
	$("#img").empty();
	s($(this).val());
})
$("button[name=button3]").click(function(){
	$("#img").empty();
	s($(this).val());
})
$("button[name=button4]").click(function(){
	$("#img").empty();
	s($(this).val());
})
$("button[name=button5]").click(function(){
	$("#img").empty();
	s($(this).val());
})



/**
 * 根据产品类型名称查询产品信息方法
 * name：产品类型名称
 */
function s (Name){
	$.ajax({
	type: "post",
	dataType: "json",
	data: {
		ProductTypeName: Name
	},
	url: "http://www.516code.cn/homePage/homepage/QueryProductTypeAll.do",
	success: function(msg) {
		for(var i = 0; i < msg.data.length; i++) {
			$("#img").append("<div class='gallery-item cars col-md-3 col-sm-4 col-xs-12'><a href='http://www.516code.cn/产品/"+msg.data[i].productImg+"' target='_blank' class='gallery-image image-popup'><img src='http://www.516code.cn/产品/"+msg.data[i].productImg+"' alt=''/><div class='content'><i class='icofont icofont-search'></i><h4>"+msg.data[i].productName+"</h4></div></a></div>");
		}
	}
});
}
